package jp.peach_boys.sandbox.slim3.entity;



import org.slim3.datastore.Attribute;
import org.slim3.datastore.Datastore;
import org.slim3.datastore.Model;

import com.google.appengine.api.datastore.Key;

@Model
public class Memo {
    @Attribute(primaryKey = true)
    private Key key;
    private String rcd;
    private String memo;
    public Key getKey() {
        return key;
    }
    public void setKey(Key key) {
        this.key = key;
    }
    public String getRcd() {
        return rcd;
    }
    public void setRcd(String rcd) {
        this.rcd = rcd;
    }
    public String getMemo() {
        return memo;
    }
    public void setMemo(String memo) {
        this.memo = memo;
    }
    public static Memo getMemo(String rcd) {
        MemoMeta meta = MemoMeta.get();
        Memo memo = Datastore.query(meta).filter(meta.rcd.equal(rcd)).asSingle();
        return memo;
    }
}
